home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 12 / Amiga Format AFCD12 (Apr 1997, Issue 96).iso / -readerstuff- / manolis_pappas / mathfx / examples / histogram.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-29  |  485 b   |  24 lines

  1. /* Test of drawing a histogram with MathFX library. */
  2. /* Copyright (©) 1995, the Xperts Group Inc. All Rights Reserved. */
  3. /* Author: Manolis S Pappas. */
  4.  
  5. #include <math.h>
  6.  
  7. main()
  8. {
  9.       int i;
  10.       float data[2048];
  11.  
  12. /* Fill up data points */
  13.  
  14.       for (i=0; i<2048; i++)
  15.         data[i]=sin(0.01*(i+1));
  16.  
  17.       fxstar(1,1);
  18.       fxhist(2048,data,-1.1,1.1,44,0);
  19.       fxlab("\\frValue","\\frFrequency",
  20.             "\\frProbability function of Oscillator");
  21.  
  22.       fxend();
  23. }
  24.